Skip to content

feat(opencode): add llmgateway-providers provider - #40310

Open
smakosh wants to merge 6 commits into
anomalyco:devfrom
smakosh:llmgateway-providers
Open

feat(opencode): add llmgateway-providers provider#40310
smakosh wants to merge 6 commits into
anomalyco:devfrom
smakosh:llmgateway-providers

Conversation

@smakosh

@smakosh smakosh commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

No issue — per CONTRIBUTING, new providers start with a models.dev PR: anomalyco/models.dev#4011.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

LLM Gateway is splitting its models.dev catalog in two (anomalyco/models.dev#4011): the existing llmgateway provider is renamed to "DevPass (LLM Gateway)" (same id, same aggregated model ids, existing configs unaffected), and a new llmgateway-providers ("LLM Gateway") provider lists provider-pinned ids like anthropic/claude-sonnet-5 — one entry per upstream deployment, same endpoint and API key.

This PR wires the new provider id where opencode keys on llmgateway today:

  • provider.ts: custom loader for llmgateway-providers with autoload: false and the referer/source headers, copied from the llmgateway entry. Both providers share LLMGATEWAY_API_KEY, so autoload stays off to avoid enabling both when the env var is set.
  • transform.ts smallOptions: the openrouter/llmgateway branch that disables reasoning for Google small-model tasks now includes llmgateway-providers. Mapped ids like google-vertex/gemini-… contain "google", so the existing api.id.includes("google") check works unchanged.
  • providers.mdx: documents the two providers in the LLM Gateway section.

No other code is needed: the core LLMGatewayPlugin matches providers by API URL (not id) so it already covers the new one, and provider icons are fetched from models.dev logos at build time.

How did you verify your code works?

  • bun run typecheck in packages/opencode passes.
  • bun test test/provider in packages/opencode (532 tests) and packages/core test/plugin/provider-llmgateway.test.ts (3 tests) pass.
  • The models.dev side (catalog + sync) validates with bun validate on the models.dev PR.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant